import axios from 'axios'
import nProgress from 'nprogress'
import 'nprogress/nprogress.css'
let requests = axios.create({
    baseURL:'/mock',
    timeout:5000
})
// 请求拦截器
requests.interceptors.request.use(config=>{
    nProgress.start()
    return config
})
//相应拦截器
requests.interceptors.response.use(res=>{
    nProgress.done()
    return res.data
},err=>{
    alert('加载失败')
})
export default requests